package com.jjx.trainingapi.common;

import lombok.Data;

/**
 * @author LoveHuahua
 * @date 2022年04月30日 13:06
 * @description believe in yourself
 */
@Data
public class MyException extends RuntimeException {

    /**
     * 状态码
     */
    private Integer code;

    /**
     * 消息
     */
    private String message;


    public MyException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public MyException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.message = errorCode.getMessage();
    }
}
